﻿<UserControl x:Class="MoPlus.SolutionBuilder.WpfClient.UserControls.MainMenu"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:MoPlus.ViewModel;assembly=MoPlus.ViewModel"
             mc:Ignorable="d" 
             d:DesignHeight="25" d:DesignWidth="300">
	<UserControl.CommandBindings>
		<CommandBinding Command="vm:CustomCommands.ExplicitOpen" CanExecute="OpenCanExecute" Executed="OpenExecuted"></CommandBinding>
	</UserControl.CommandBindings>
	<UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Theme.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <DockPanel>
        <Menu DockPanel.Dock="Top">
			<MenuItem Header="{Binding MenuLabelFile}">
				<MenuItem Header="{Binding MenuLabelNewSolution}" Command="{Binding NewSolutionCommand}"/>
				<MenuItem Header="{Binding MenuLabelOpenSolution}" Command="{Binding OpenSolutionCommand}"/>
				<MenuItem Header="{Binding MenuLabelRecentSolutions}" ItemsSource="{Binding RecentSolutions, Mode=OneWay}">
					<MenuItem.ItemContainerStyle>
						<Style TargetType="MenuItem" BasedOn="{StaticResource SubMenuLeafItem}">
							<Setter Property="Header" Value="{Binding Header}"/>
							<Setter Property="Command" Value="vm:CustomCommands.ExplicitOpen"/>
							<Setter Property="CommandParameter" Value="{Binding RecentSolutionLocation}"/>
						</Style>
					</MenuItem.ItemContainerStyle>
				</MenuItem>
				<MenuItem Header="{Binding MenuLabelSaveAll}" Command="{Binding SaveAllCommand}"/>
				<MenuItem Header="{Binding MenuLabelCancelJobs}" Command="{Binding CancelJobsCommand}"/>
				<MenuItem Header="{Binding MenuLabelExit}" Command="{Binding ExitCommand}"/>
			</MenuItem>
			<MenuItem Header="{Binding MenuLabelHelp}">
				<MenuItem Header="{Binding MenuLabelHelpGettingStarted}" Command="{Binding HelpGettingStartedCommand}"/>
				<MenuItem Header="{Binding MenuLabelHelpAbout}" Command="{Binding HelpAboutCommand}"/>
            </MenuItem>
        </Menu>
    </DockPanel>
</UserControl>

